//
//  NativePushChannel.m
//  kq_flutter_core_widget
//
//  Created by wtb on 2024/1/6.
//

#import "NativePushChannel.h"

@implementation NativePushChannel
+(void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar{
    FlutterMethodChannel *channel = [FlutterMethodChannel methodChannelWithName:@"flutter.keqiang.com/push" binaryMessenger:[registrar messenger]];
    NativePushChannel *push = [[NativePushChannel alloc] init];
    [registrar addMethodCallDelegate:push channel:channel];
}

-(void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result{
    // 安卓端实现了该方法
    if ([@"turnOnPushChannel" isEqualToString:call.method]) {
        // 开启推送通道，iOS程序启动就开启，无需处理
    }else if([@"turnOffPushChannel" isEqualToString:call.method]){
        // 关闭通道
    }else if([@"setAlias" isEqualToString:call.method]){
        // 设置别名
    }else if([@"removeAlias" isEqualToString:call.method]){
        // 删除别名
    }
    result(@"");
}
@end
